if(strcmp(cmd,"/Carhelp",true)==0)
{
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xFFFFFFFF,"Usage : /Carhelp [1-3]");
if(strcmp(tmp,"1",true))
{
SendClientMessage(playerid,0x0099FFFF,"-------- [Vehicle/Car System!] --------");
SendClientMessage(playerid,0x00FF00FF,"/Car - Information about a vehicle.");
SendClientMessage(playerid,0x00FF00FF,"/Cars - Information with Statistics about the server vehicles.");
SendClientMessage(playerid,0x00FF00FF,"/Buycar - To buy a vehicle.");
SendClientMessage(playerid,0x00FF00FF,"/Sellcar - To sell your own vehicle.");
SendClientMessage(playerid,0x00FF00FF,"/Callcar - To call your vehicle to your currect position.");
SendClientMessage(playerid,0x0099FFFF,"-------- [Carhelp Page 1] --------");
}
if(strcmp(tmp,"2",true))
{
SendClientMessage(playerid,0x0099FFFF,"-------- [Vehicle/Car System!] --------");
SendClientMessage(playerid,0x00FF00FF,"/Watch[Car/off] - To spectate your vehicle.");
SendClientMessage(playerid,0x00FF00FF,"/[Un]lock - To lock/unlock your vehicle.");
SendClientMessage(playerid,0x00FF00FF,"/Resetcar - To reset your vehicle to his parking lot.");
SendClientMessage(playerid,0x00FF00FF,"/Eject[All] - To eject a player from your vehicle.");
SendClientMessage(playerid,0x0099FFFF,"-------- [Carhelp Page 2] --------");
}
return 1;
}
return 0;
}
if(strlen(tmp) == 0)
It would be easyer to use sscanf but try.
pawn Код:
|
if(strlen(tmp) == 0) return SendClientMessage(playerid,0xFFFFFFFF,"Usage : /Carhelp [1-3]");
Why don't you use ZCMD and sscanf? It's way simpler and easier!
|
if(!strcmp(tmp,"1",true)) return // usage
else
{
//code
}
ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"Vehicle/Car System","/car - Information about a vehicle\n/cars -Information with statisctics about the server vehicles\n/buycar - buy a vehicle\n/sellcar - Sell your car\n/callcar - call your car","Ok","");
PHP код:
|
new part1[] = "\n/car - Info about your vehicle\n/cars - Statistics about the server vehicles\n/buycar - Buy a vehicle\n/sellcar - to sell your vehicle\n/callcar - call your vehicle";
new part2[] = "\n/watch[car/off] - to spectate your vehicle\n/[Un]lock - To lock/unlock your vehicle\n/resetcar - to reset your vehicle to the parked position\n/eject[all] - To eject a player from your vehicle";
new string[128];
format(string, sizeof(string),"%s %s",part1,part2);
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX,"Vehicle Car System",string,"Done","");