Advertisement
Guest User

Untitled

a guest
Mar 10th, 2015
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. if(strcmp(cmd, "/setplate", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(PlayerInfo[playerid][pAdmin] >= 5)
  6. {
  7. tmp = strtok(cmdtext, idx);
  8. if(!strlen(tmp))
  9. {
  10. SendClientMessage(playerid, COLOR_LIGHTGREEN, "{FFFFFF}[{F81414}wZone RPG{FFFFFF}]: /setplate [carid] [plate]");
  11. return 1;
  12. }
  13. new hid = strval(tmp);
  14. new length = strlen(cmdtext);
  15. while ((idx < length) && (cmdtext[idx] <= ' '))
  16. {
  17. idx++;
  18. }
  19. new offset = idx;
  20. new result[256];
  21. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  22. {
  23. result[idx - offset] = cmdtext[idx];
  24. idx++;
  25. }
  26. result[idx - offset] = EOS;
  27. if(!strlen(result))
  28. {
  29. SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}[{F81414}wZone RPG{FFFFFF}]: /setplate [carid] [plate]");
  30. }
  31. strmid(CarInfo[hid][cNum], result, 0, 64, 255);
  32. SetVehicleNumberPlate(hid,result);
  33. SetVehicleToRespawn(hid);
  34. format(string, sizeof(string), "Placuta masinii %d setata la %s",hid,(result));
  35. SendClientMessage(playerid, COLOR_WHITE, string);
  36. }
  37. }
  38. return 1;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement