SA-MP Forums Archive
Command not recognised + Cooordinates - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command not recognised + Cooordinates (/showthread.php?tid=122833)



Command not recognised + Cooordinates - Moglizorz. - 23.01.2010

I currently have /achat and I want to change it to /a but when I do I get an unrecognised command.

Quote:

if (strcmp("/achat", cmdtext, true, 6) == 0 && PlayerAdminLevel[playerid] == 1337) // Talk To Other Admins
{
if(strlen(cmdtext) <= 7) {
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /achat (msg)");
return 1;
}
new output[255];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,7,strlen(cmdtext));
format(string, sizeof(string), "Admin Chat: %s(%d) %s",pname,playerid,output);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerAdminLevel[i] == 1337) {
format(string, sizeof(string), "Admin Chat: %s(%d) %s",pname,playerid,output);
SendClientMessage(i,0xFF7F50AA,string);
}
}
return 1;
}

My next issue is that I got some coordinates

{2059.8872, 1202.8521, 2120.8960, 1302.8754}

I don't know how I put these into the teleport command.

SetPlayerPos(playerid,);


Re: Command not recognised + Cooordinates - Moglizorz. - 23.01.2010

Anyone?


Re: Command not recognised + Cooordinates - LuxurioN™ - 23.01.2010

Try this (I not tested):

pawn Код:
if (strcmp("/achat", cmdtext, true, 6) == 0) // Talk To Other Admins
{
if(PlayerAdminLevel[playerid] == 1337)
{
if(strlen(cmdtext) <= 7)
return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /achat (msg)");
new output[255];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,7,strlen(cmdtext));
format(string, sizeof(string), "Admin Chat: %s(%d): %s",pname,playerid,output);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
format(string, sizeof(string), "Admin Chat: %s(%d): %s",pname,playerid,output);
SendClientMessage(i,0xFF7F50AA,string);
}
}
return 1;
}
And, to put coordinates in teleport:

pawn Код:
SetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
Exemple:

pawn Код:
SetPlayerPos(playerid,2059.8872, 1202.8521, 2120.8960);