/gotocoord
#1

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;
}
Reply
#2

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

oh shit.. wrong thing :O

Reply
#4

So whats your problem anyway?
Reply
#5

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

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;
}
Reply
#7

Hmms.
Reply
#8

Код:
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;
}
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)