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



IfPlayerLogged - [GOD]Dragonster82 - 03.10.2011

pawn Код:
public OnPlayerSpawn(playerid)
{
new CheckForDarren[MAX_PLAYER_NAME];
GetPlayerName(playerid,CheckForDarren,sizeof(CheckForDarren));
    if(skink==270) && CheckForDarren == "Darren_Kok" {
    new string[128];
    format(string,sizeof(string),"Welcome back Darren")
    SetPlayerTeam(playerid, 1);
    GangRank[playerid] = 1337;
    SendClientMessage(COLOR_PURPLE,string);
    }
    return 1;
Ignore the ranks and stuff, but how can i use IsPlayerLogged from Luxadmin to my gamemode script?


Re: IfPlayerLogged - TheLazySloth - 03.10.2011

public OnPlayerSpawn(playerid)
{
new CheckForDarren[MAX_PLAYER_NAME];
GetPlayerName(playerid,CheckForDarren,sizeof(Check ForDarren));
if(skink==270) && CheckForDarren == "Darren_Kok" {
new string[128];
format(string,sizeof(string),"Welcome back Darren")
SetPlayerTeam(playerid, 1);
GangRank[playerid] = 1337;
SendClientMessage(COLOR_PURPLE,string);
}
return 1;

should be...

public OnPlayerSpawn(playerid)
{
new CheckForDarren[MAX_PLAYER_NAME];
GetPlayerName(playerid,CheckForDarren,sizeof(Check ForDarren));
if(skink==270 && strcmp(CheckForDarren, "Darren_Kok", true) {
new string[128];
format(string,sizeof(string),"Welcome back Darren")
SetPlayerTeam(playerid, 1);
GangRank[playerid] = 1337;
SendClientMessage(COLOR_PURPLE,string);
}
return 1;
}


Re: IfPlayerLogged - [GOD]Dragonster82 - 03.10.2011

Edit:

(594) : error 029: invalid expression, assumed zero

Error


Re: IfPlayerLogged - [HiC]TheKiller - 03.10.2011

You should look into using Player Variables for this instance.

https://sampwiki.blast.hk/wiki/SetPVarInt
https://sampwiki.blast.hk/wiki/GetPVarInt


Re: IfPlayerLogged - [GOD]Dragonster82 - 03.10.2011

To take it literally.
SetPVarInt(playerid, "Name", GetPlayerName(playerid));

Doesn't works