[HELP] Command - 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)
+--- Thread: [HELP] Command (
/showthread.php?tid=512520)
[HELP] Command -
monster010 - 11.05.2014
I did like this command to show the name of the uses. But I see it does not work. Why?
pawn Код:
if(strcmp(cmd, "/gethere", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [playerid/PartOfName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,0);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(plo,1);
PlayerInfo[plo][pInt] = 1;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
new string1[256];
SendClientMessage(plo, COLOR_GRAD1, " You have been teleported");
format(string1, sizeof(string1), "[ANTI-ABUSING] %s has using /gethere command !", sendername);
SendClientMessageToAll(COLOR_LIGHTRED, string1);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Re: [HELP] Command -
Beckett - 11.05.2014
pawn Код:
if(strcmp(cmd, "/gethere", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [playerid/PartOfName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,0);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(plo,1);
PlayerInfo[plo][pInt] = 1;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
new string1[256];
SendClientMessage(plo, COLOR_GRAD1, " You have been teleported");
format(string1, sizeof(string1), "[ANTI-ABUSING] %s has using /gethere command !", sendername(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string1);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Try this code.
Re: [HELP] Command -
monster010 - 11.05.2014
What did you do / change?