10.04.2012, 14:40
I do not know how to save the plate number, when it logout or the park the vehicle,
please help me, im newbie
I use this code..
please help me, im newbie
I use this code..
Код:
CMD:plate(playerid,params[]) { new plate[20],id, string[128], string2[128], splate[22], vehid, victimname[MAX_PLAYER_NAME], admname[MAX_PLAYER_NAME]; if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GREY,"[ERROR]: You must be a RCON administrator!"); if (sscanf(params, "us[20]", id,plate)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /plate [id] [plate]"); if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"[ERROR]: That user isn't online!"); if (strlen(plate) > 20 || strlen(plate) < 1) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /plate [id] [plate] (length 0-20)"); if (GetPlayerState(id) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_GREY,"[ERROR]: The player isn't the driver or he isn't at any vehicle!"); GetPlayerName(id,victimname,MAX_PLAYER_NAME); GetPlayerName(playerid,admname,MAX_PLAYER_NAME); vehid = GetPlayerVehicleID(id); format(string,128,"You set %s's plate to %s.",victimname,plate); format(string2,128,"Your plate was set to %s by RCON administrator %s.",plate, admname); format(splate, 22,"%s",plate); SetVehicleNumberPlate(vehid, plate); RemovePlayerFromVehicle(id); SetTimerEx("Respawn",2000,false,"i",id); SendClientMessage(playerid,COLOR_GREY,string); SendClientMessage(id,COLOR_GREY,string2); return 1; }