06.04.2010, 20:17
I made some commands in pawno and I go on my server and use the command and it says: SERVER: unknown command
Why wont they work?
What am i doing wrong?
Why wont they work?
What am i doing wrong?
Originally Posted by andmeida10
show your command... we don't guess
|
if(strcmp(cmd, "/moutbike", true) == 0) { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600); SetVehicleZAngle(VehicleID, ang); return 1; }
Originally Posted by [AC
Etch ]
use dcmd+sscanf they are alot easier from strcmp + strtok |
Originally Posted by [TW
randomguy ]
Quote:
|
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/hydra", cmdtext, true, 10) == 0) { { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600); SetVehicleZAngle(VehicleID, ang); return 1; }
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/yourcmd", cmdtext, false))
{
//bla bla bla
return 1;
}
if(!strcmp("/anothercmd", cmdtext, false))
{
//more bla bla bla
return 1;
}
return 0; //make absolute sure this is the last line in OnPlayerCommandText.
}
Originally Posted by [TW
randomguy ]
Код:
if(strcmp(cmd, "/moutbike", true) == 0) { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600); SetVehicleZAngle(VehicleID, ang); return 1; } |
Originally Posted by [TW
randomguy ]
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/hydra", cmdtext, true, 10) == 0) { { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600); SetVehicleZAngle(VehicleID, ang); return 1; } |
if (strcmp("/hydra", cmdtext, true, 10) == 0) { { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600); SetVehicleZAngle(VehicleID, ang); } return 1; }
if (strcmp("/hydra", cmdtext, true, 10) == 0) { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600); SetVehicleZAngle(VehicleID, ang); return 1; }