14.05.2010, 23:54
fijate asi...
si no como el ladmin4v2:
pawn Код:
if(strcmp(cmdtext, "/comando", true) == 0){
new tmp2[256], tmp3[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
tmp3 = strtok(cmdtext, idx);
if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3))return SendClientMessage(playerid, color, "ERROR: Uso: /comando <Coordenada X> <Coordenada Y> <Coordenada Z>");
new Float:X, Float:Y, Float:Z, str[128];
X = strval(tmp);
Y = strval(tmp2);
Z = strval(tmp3);
SetPlayerPos(playerid, X, Y, Z);
format(str, sizeof(str), "Has ido a %s, %s, %s", X, Y, Z);
SendClientMessage(playerid, color, str);
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(lgoto,7,cmdtext);
return 0;
}
dcmd_lgoto(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid)) {
new Float:x, Float:y, Float:z;
new tmp[256], tmp2[256], tmp3[256];
new string[128], Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid,red,"USAGE: /lgoto [x] [y] [z]");
x = strval(tmp);
y = strval(tmp2);
z = strval(tmp3);
//CMDMessageToAdmins(playerid,"LGOTO");
if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
else SetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"You have teleported to %f, %f, %f", x,y,z); return SendClientMessage(playerid,blue,string);
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}