05.01.2018, 12:31
Quote:
change
public OnPlayerCommandText(playerid, cmdtext[]) to public OnPlayerCommandPerformed(playerid, cmdtext[], success) |
change it to this...
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
new cmd[256], idx, tmp[256], string[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/int", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /int [id]");
return 1;
}
new playa;
playa = strval(tmp);
if(playa < 146 && playa >= 0)
{
format(string, sizeof(string), "Int %d: %s", playa, IntName[playa]);
SendClientMessage(playerid, 0xFFFFFFAA, string);
SetPlayerInterior(playerid, IntArray2[playa][0]);
SetPlayerPos(playerid, IntArray[playa][0], IntArray[playa][1], IntArray[playa][2]);
SetPlayerFacingAngle(playerid, IntArray[playa][3]);
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/intlist", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /intlist [startid]");
return 1;
}
new playa;
playa = strval(tmp);
if(playa < 146 && playa >= 0)
{
format(string, sizeof(string), "Int %d: %s", playa, IntName[playa]);
SendClientMessage(playerid, 0xFFFFFFAA, string);
new intid = playa+1;
while(intid < playa+10)
{
if(intid < 146 && intid >= 0)
{
format(string, sizeof(string), "Int %d: %s", intid, IntName[intid]);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
intid += 1;
}
return 1;
}
}
return 1;
}
if(!sucess) return 0;
else return 1;
}