Guten Tag / Abend
Ich habe mehrere Probleme und zwar kann ich
1. Die NoobRoller nicht respawnen
2. Funzt aufeinmal ./m nicht mehr
hier mal die codes
3. wenn ich als leader einer fraktion autos respawne respawnen fast alle nur eins nicht
1.
Ganz oben irgendwo
new NoobRoller[12];
forward IsANoobBike(carid);
public IsANoobBike(carid)
{
for(new i = 0; i < sizeof(NoobRoller); i++)
{
if(carid == NoobRoller[i])
{
return 1;
}
}
return 0;
}
OnGameModeInit
NoobRoller[0]=AddStaticVehicleEx(462,1120.56054688,-1475.15539551,15.46709442,0.00000000,-1,-1,60000); //Faggio
NoobRoller[1]=AddStaticVehicleEx(462,1120.47985840,-1480.18090820,15.46709442,0.00000000,-1,-1,60000); //Faggio
NoobRoller[2]=AddStaticVehicleEx(462,1120.59765625,-...
unter OnPlayerStateChange
if(IsANoobBike(newcar))
{
}
2.
oben im script
new FbiCars[21];
forward IsAFbiCar(carid);
public IsAFbiCar(carid)
{
for(new i = 0; i < sizeof(FbiCars); i++)
{
if(carid == FbiCars[i])
{
return 1;
}
}
return 0;
}
ongamemodeinit
FbiCars[0]=AddStaticVehicleEx(415,983.85302734,1155.42651367,10.66983414,180.00000000,0,0,-1); //Cheetah
...
onplayercommandtext
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(IsPlayerConnected(playerid)) {
new tmpcar = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: (/m)egaphone [megaphone chat]");
return 1;
}
if(IsACop(playerid) || IsAMedic(playerid))
{
if(IsACopCar(tmpcar) || IsAFbiCar(tmpcar) || IsAArmyCar(tmpcar) || IsAMayorCar(tmpcar) || IsAMedicCar(tmpcar))
{
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
{
format(string, sizeof(string), "[Polizist %s: %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
{
format(string, sizeof(string), "[Agent %s: %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3)
{
format(string, sizeof(string), "[Soldat %s: %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
format(string, sizeof(string), "[Sanitäter %s: %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keinem Staatsfahrzeug !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist kein Polizist !");
return 1;
}
}
return 1;
}
3.
new LSPDCars[36];
forward IsACopCar(carid);
public IsACopCar(carid)
{
for(new i = 0; i < sizeof(LSPDCars); i++)
{
if(carid == LSPDCars[i])
{
return 1;
}
}
return 0;
}
Ongamemodeinit
LSPDCars[0]=AddStaticVehicleEx(596,1601.16735840,-1684.26647949,5.71062469,90.00000000,0,1,-1); //Police Car (LSPD)
...
onplayercommandtext
if(strcmp(cmd, "/respawnfc", true) == 0)
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 5)
{
for(new i = 0; i < sizeof(LSPDCars); i++)
{
SetVehicleToRespawn(LSPDCars[i]);
}
}
}
edit
sry habe grade formatierungsprobleme