21.09.2011, 14:05
pawn Код:
if(strcmp(cmdtext, "/fixcar", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "* Usuage: /fixcar [Player ID/part of name]");
return 1;
}
print("Before giveplayerid returnuser");
giveplayerid = ReturnUser(tmp);
print("After giveplayerid return user");
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[playerid][pAdmin] >= 99999)
{
if(PlayerInfo[giveplayerid][pVehicle] == 1)
{
PlayerInfo[giveplayerid][pVehicle] = 0;
format(string, sizeof(string), "* You set %s's car value to 0.", PlayerName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Admin %s set your car value to 0.", PlayerName(playerid));
SendClientMessage(giveplayerid, COLOR_GREY, string);
return 1;
}
if(PlayerInfo[giveplayerid][pVehicle] == 0)
{
PlayerInfo[giveplayerid][pVehicle] = 1;
format(string, sizeof(string), "* You set %s's car value to 1.", PlayerName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Admin %s set your car value to 1.", PlayerName(playerid));
SendClientMessage(giveplayerid, COLOR_GREY, string);
return 1;
}
}
else SendClientMessage(playerid, COLOR_GREY, "* User is not connected !");
}
return 1;
}
If I do "/fixcar *nothing here*" then it sends me the usuage message, but if I do "/fixcar *something here*" it does nothing and prints nothing. :S