31.12.2010, 16:25
Well i've got numbers to completely save as they're attached to the car when it is purchased but i am having trouble using Letters in the license plate
Here is what i have on OnVehicleSpawn
And here is my /plate command.
Whats my problem? Can some help me fix this, or even give me a working code for license plates.
Here is what i have on OnVehicleSpawn
Код:
} if(IsAnOwnableCar(vehicleid)) { new key; new playerid; if(ForwardOwnCar(1,playerid)) { key = 1; } else if(ForwardOwnCar(2,playerid)) { key = 2; } else if(ForwardOwnCar(3,playerid)) { key = 3; } else { return 1; } format(string, sizeof(string),"%d",CarInfo[key][cPlate],CarInfo[key][cPlate]); SetVehicleNumberPlate(vehicleid, string); }
Код:
if(strcmp(cmd, "/plate", true) == 0) { if(!IsPlayerConnected(playerid)) { return 0; } if(PlayerInfo[playerid][pDonateRank]!=3) { SendClientMessage(playerid,COLOR_GRAD2,"You are not even a donator!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /plate [number/name]"); return 1; } else if(strlen(tmp) > 32) { SendClientMessage(playerid, COLOR_GRAD1, "ERROR: Plate text can't be longer then 32 characters (including colors)."); return 1; } else { new Float:vx, Float:vy, Float:vz; new tempveh = GetPlayerVehicleID(playerid); GetVehiclePos(tempveh, vx, vy, vz); SetVehicleNumberPlate(tempveh, tmp); new key; if(ForwardOwnCar(1,playerid)) { key = 1; } else if(ForwardOwnCar(2,playerid)) { key = 2; } else if(ForwardOwnCar(3,playerid)) { key = 3; } else { return 1; } CarInfo[key][cPlate] = tmp[28]; SetVehicleToRespawn(tempveh); SetVehiclePos(tempveh, vx, vy, vz); PutPlayerInVehicle(playerid, tempveh, 0); } return 1; }