What's wrong with this code?
#2

Give this code a try

pawn Код:
COMMAND:fixcar(playerid, params[])
{
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid,  COLOR_GREY, "* Usuage: /fixcar [Player ID/part of name]");
    if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
    if(PlayerInfo[playerid][pAdmin] >=! 99999) return SendClientMessage(playerid, COLOR_RED, "You are not an admin");
    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);
    }
    else 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;
}
Reply


Messages In This Thread
What's wrong with this code? - by Jack_Leslie - 21.09.2011, 14:05
Re: What's wrong with this code? - by Cowboy - 21.09.2011, 14:52
Re: What's wrong with this code? - by Elmin - 21.09.2011, 14:57
Re: What's wrong with this code? - by Jack_Leslie - 21.09.2011, 21:48
Re: What's wrong with this code? - by admantis - 21.09.2011, 23:08
Re: What's wrong with this code? - by Jack_Leslie - 22.09.2011, 00:10
Re: What's wrong with this code? - by Jefff - 22.09.2011, 00:20

Forum Jump:


Users browsing this thread: 1 Guest(s)