24.03.2016, 09:35
Hi.
I made a command which checks what vehicles a player owns. It checks that by comparing the player's name with the owner name of a vehicle which is stored in the vehicle's folder.
In one case, when ^ that ^ is executed, it gives me this:
----------Vehicles (3/3)----------
SERVER: Unknown Command
(There are 3 vehicles spawned in total in the server)
In another case, when I replace the string comparing with:
It returns me this:
----------Vehicles (0/3)----------
Any suggestions that can help?
I made a command which checks what vehicles a player owns. It checks that by comparing the player's name with the owner name of a vehicle which is stored in the vehicle's folder.
Код:
CMD:myvehicles(playerid) { new string[160],vehicles; for(new i = 0; i < MAX_CUSTOM_VEHICLES; i++) { if(DVehicles[i][dModel] != 0){ if(strcmp(PlayerInfo[playerid][pRealName], DVehicles[i][vOwner], true) == 0) { vehicles = vehicles + 1; }} } format(string,sizeof(string),"{989898}----------Vehicles (%d/3)----------",vehicles); SendClientMessage(playerid,-1,string); for(new i = 0; i < MAX_CUSTOM_VEHICLES; i++) { if(strcmp(PlayerInfo[playerid][pRealName], DVehicles[i][vOwner], true) == 0) { format(string,sizeof(string),"{989898}ID %d | %s",i,GetVehicleName(i)); SendClientMessage(playerid,-1,string); } } return 1; }
----------Vehicles (3/3)----------
SERVER: Unknown Command
(There are 3 vehicles spawned in total in the server)
In another case, when I replace the string comparing with:
Код:
if(strcmp(PlayerInfo[playerid][pRealName], DVehicles[i][vOwner], true) == 1)
----------Vehicles (0/3)----------
Any suggestions that can help?