21.01.2011, 03:40
Hi,
I want to create a command who check the car spawn and a name.
My code:
So I'm John_Turn I spawn a car id= 1, in my log:
"veh 1"
"check John_Turn,John_Turn"
"VEHiCLE SPAWN"
Perfect but if I dont spawn a vehicle I have in my log:
"veh 1"
"check John_Turn, " nothing
"VEHiCLE SPAWN"
So if VehicleInfo[i][Owner] = my name or nothing, it say my car is spawn. This problиme is if(strcmp(gpname, VehicleInfo[i][Owner], true) == 0) Ihve tested !=1 ... but identical.
Help thanks.
I want to create a command who check the car spawn and a name.
My code:
Код:
GetPlayerName(giveplayerid, gpname, MAX_PLAYER_NAME); for(new i = 0; i < MAX_VEHICLES; iv++) { printf("veh %d",i); if(strcmp(gpname, VehicleInfo[i][Owner], true) == 0) // gpname is the name , VehicleInfo[i][Owner] is the owner { printf("check %s,%s",gpnme,VehicleInfo[i][Owner]); print("VEHiCLE SPAWN"); return 1 ; } }
"veh 1"
"check John_Turn,John_Turn"
"VEHiCLE SPAWN"
Perfect but if I dont spawn a vehicle I have in my log:
"veh 1"
"check John_Turn, " nothing
"VEHiCLE SPAWN"
So if VehicleInfo[i][Owner] = my name or nothing, it say my car is spawn. This problиme is if(strcmp(gpname, VehicleInfo[i][Owner], true) == 0) Ihve tested !=1 ... but identical.
Help thanks.