23.01.2011, 12:09
I solved the problem. It doesn't alterate the next car, but now the only problem is that it saves just 8 chars. I type "LS-96-MRK" and it shows LS-96-MR.
The codes are:
The cmd is:
At LoadCar()
Edit: I tried LS96MRK and it saves just LS96MR. I think it saves just 4 letters.
The codes are:
Код:
cPlate[16], at CarInfo
Код:
if (strcmp(cmd, "/changeplate", true, 12)==0) { cmd = strtok(cmdtext, idx); if(!strlen(cmd)) { SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [numar. foloseste '-' pentru spatiu]"); return 1; } if(IsPlayerInAnyVehicle(playerid) == 1) { if(!IsACop(playerid)) { SendClientMessage(playerid, COLOR_GREY, " Nu esti politist!"); return 1; } SetVehicleNumberPlate(GetPlayerVehicleID(playerid), cmd); new vehid=GetPlayerVehicleID(playerid); strmid(CarInfo[vehid][cPlate], cmd, 0, 16, strlen(cmd)); SetVehicleToRespawn(vehid); SendClientMessage(playerid, 0xFF9900AA, "Numar schimbat!"); new Float:x; new Float:y; new Float:z; GetPlayerPos(playerid, x, y, z); SetVehiclePos(vehid, x+5, y, z); return 1; } else { SendClientMessage(playerid, 0xFF9900AA, "Nu esti intr-o masina."); } return 1; }
Код:
strmid(CarInfo[idx][cPlate], arrCoords[13], 0, strlen(arrCoords[13]), 16);