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



Need help - [UG]Daniel - 30.07.2013

I have been searching for a strcmp /s and /l cmd and didnt find any.
can you guys help me? :/


Re: Need help - Facerafter - 30.07.2013

/s and /l cmd? So you mean /shout and /low for RP Servers?


Re: Need help - [UG]Daniel - 30.07.2013

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
/s and /l cmd? So you mean /shout and /low for RP Servers?
No, /s = save position /l = load position


Re: Need help - ScRipTeRi - 30.07.2013

pawn Код:
#include <a_samp>

new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS];
new ActivePos[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
ActivePos[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
ActivePos[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/s", true) == 0)
    {
         GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
         SendClientMessage(playerid, -1, "Your pos saved.");
         ActivePos[playerid] = 1;
         return 1;
    }
    if(strcmp(cmdtext, "/l", true) == 0)
    {
    if(ActivePos[playerid] == 1)
    {
    SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
    SendClientMessage(playerid, -1, "Your pos loadet.");
    ActivePos[playerid] = 0;
    return 1;
    }
    }
    return 1;
    }



Re: Need help - [UG]Daniel - 30.07.2013

Quote:
Originally Posted by ScRipTeRi
Посмотреть сообщение
pawn Код:
#include <a_samp>

new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS];
new ActivePos[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
ActivePos[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
ActivePos[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/s", true) == 0)
    {
         GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
         SendClientMessage(playerid, -1, "Your pos saved.");
         ActivePos[playerid] = 1;
         return 1;
    }
    if(strcmp(cmdtext, "/l", true) == 0)
    {
    if(ActivePos[playerid] == 1)
    {
    SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
    SendClientMessage(playerid, -1, "Your pos loadet.");
    ActivePos[playerid] = 0;
    return 1;
    }
    }
    return 1;
    }
Thank you so much bro!
+REP