SA-MP Forums Archive
/gotocoord - 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: /gotocoord (/showthread.php?tid=151814)



/gotocoord - Antonio [G-RP] - 01.06.2010

I thought... but I thought wrong.. what did I do? Thanks

pawn Код:
if(strcmp(cmd, "/gotocoord", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
return 1;
}
new x = strval(tmp);
new y = strval(tmp);
new z = strval(tmp);
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_DBLUE, "You have been teleported");
return 1;
}



Re: /gotocoord - Toni - 01.06.2010

what the hell is this? all this is a advertisement. And you Failed Big Time.


Re: /gotocoord - Antonio [G-RP] - 01.06.2010

oh shit.. wrong thing :O




Re: /gotocoord - Toni - 01.06.2010

So whats your problem anyway?


Re: /gotocoord - Antonio [G-RP] - 01.06.2010

It sends you to that farm that you go to if your coords are fucked (0,0,0) i belive


Re: /gotocoord - shady91 - 01.06.2010

Here is my goto co ords command it's ZCMD but this is only to show you how it's done

pawn Код:
cmd(gotoc, playerid, params[])
{
if(GetPVarInt(playerid, "Admin") > 2){
new Float:x, Float:y, Float:z, intt;
if(sscanf(params, "fffi", x, y, z, intt))return SendClientMessage(playerid, grey, "/gotoc [float1] [float2] [float3] [int]");
SetPlayerPos(playerid, x, y, z);
SetPlayerInterior(playerid, intt);}
return 1;
}



Re: /gotocoord - Antonio [G-RP] - 01.06.2010

Hmms.


Re: /gotocoord - coole210 - 01.06.2010

Код:
if(strcmp(cmd, "/gotocoord", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new x = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new y = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new z = strval(tmp);
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_DBLUE, "You have been teleported");
return 1;
}



Re: /gotocoord - shady91 - 01.06.2010

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
Hmms.
?? is this to bump your post?
Quote:
Originally Posted by Coole[AG
]
Код:
if(strcmp(cmd, "/gotocoord", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new x = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new y = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new z = strval(tmp);
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_DBLUE, "You have been teleported");
return 1;
}
see how messy that code look's, look how much neater ZCMD and Sscanf are, it's also allot easier.


Re: /gotocoord - Antonio [G-RP] - 01.06.2010

Quote:
Originally Posted by Shady91
Quote:
Originally Posted by Coole[AG
]
Код:
if(strcmp(cmd, "/gotocoord", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new x = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new y = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new z = strval(tmp);
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_DBLUE, "You have been teleported");
return 1;
}
see how messy that code look's, look how much neater ZCMD and Sscanf are, it's also allot easier.
Oh well
Quote:
Originally Posted by Coole[AG
]
Код:
if(strcmp(cmd, "/gotocoord", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid, COLOR_RED, "Invalid admin level, you cannot use this command");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new x = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new y = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /gotocoord (X) (Y) (Z)");
new z = strval(tmp);
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_DBLUE, "You have been teleported");
return 1;
}
Thanks bra