22.01.2019, 18:26
Can somebody explain to me, how the /frespawn all works, but frespawn <id> no longer works? It worked before I changed if(str to if(!str
pawn Code:
YCMD:frespawn(playerid, params[]) {
new vehicleid, text[12];
if(PlayerInfo[playerid][pFaction] != 0 && FactionInfo[PlayerInfo[playerid][pFaction]][fLeaderrank] >= PlayerInfo[playerid][pRank] - 1)
{
if(sscanf(params, "s[12]", text)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /frespawn [vehicleid/all]");
if(!strcmp("all", text))
{
for(new v = GetVehiclePoolSize(); v > 0; v--)
{
if(VehicleInfo[v][vFaction] != 0 && PlayerInfo[playerid][pFaction])
{
SetVehicleToRespawn(v);
}
}
return 1;
}
else
{
new vehicleidint = strval(text);
if(VehicleInfo[vehicleidint][vFaction] == PlayerInfo[vehicleidint][pFaction])
{
SetVehicleToRespawn(vehicleidint);
}
}
}
else return SendClientMessage(playerid, -1, "nope...");
return 1;
}