23.12.2012, 20:07
So, I thought my code was fine... I'm wondering what's wrong.. When I type the command properly, nothing shows up, and the car doesn't repair. But if I type /fixveh, it does the client message stating proper usage ofc. What's wrong?
Код:
if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new playa;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fixveh [playerid/PartOfName]");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); return 1;
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_GREY, string);
format(string, sizeof(string), "* Admin %s has fixed your vehicle.",sendername);
}
else
{
SendClientMessage(playerid, COLOR_GREY, string);
format(string, sizeof(string),"I know you could fix cars, but since when can you fix players? %s isn't in a car. -Alex", PlayerName(giveplayerid));
}
}
}
}
return 1;
}


- For any others with this problem or who needs it; here's the code.