SA-MP Forums Archive
Need help with a script part. - 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 with a script part. (/showthread.php?tid=315264)



Need help with a script part. - Lorenzo! - 02.02.2012

nevermind


Re: Need help with a script part. - milanosie - 02.02.2012

where did u define extraid?


Re: Need help with a script part. - Lorenzo! - 02.02.2012

Quote:
Originally Posted by milanosie
View Post
where did u define extraid?
What you mean?


Re: Need help with a script part. - Vince - 02.02.2012

Quote:
Originally Posted by Lorenzo!
View Post
Well, I am currently copying a Roleplay server
Fixed. If you did all those lines of code by yourself, you would've noticed these two very obvious errors already. extraid needs to be playerid and you missed a semicolon on the subsequent line.


Re: Need help with a script part. - milanosie - 02.02.2012

well, extraid is custom

so u need to

new extraid;

at the top of ur script or code


Re: Need help with a script part. - Hoss - 02.02.2012

pawn Code:
CMD:dutyon(playerid,params[]) {
new extraid;    // You have to define extraid
if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0) {
        new string[64];
        if(IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10) {
            SendClientMessage(playerid, COLOR_GREY, "Turned your duty to [ON]");
            format(szMessage, sizeof(szMessage), "(Group) "EMBED_WHITE"%s is now on duty..", szPlayerName);
            SendToGroup(playerVariables[extraid][pGroup], COLOR_GENANNOUNCE, szMessage);
            SetPlayerColor(playerid,COLOR_BLUE)
  }
    }
    return 1;
}



Re: Need help with a script part. - Lorenzo! - 02.02.2012

Quote:
Originally Posted by Vince
View Post
Fixed. If you did all those lines of code by yourself, you would've noticed these two very obvious errors already. extraid needs to be playerid and you missed a semicolon on the subsequent line.
I am not, but what about this?:

C:\Users\5740_434G64mn\Desktop\Bayside-Roleplaygamemodes\BS-RP.pwn(11452) : error 001: expected token: ";", but found "}"


Re: Need help with a script part. - Vince - 02.02.2012

I am sure you are copying it! Because that is probably THE most basic mistake that exists!

pawn Code:
SetPlayerColor(playerid,COLOR_BLUE); // <<<< SEMICOLON!



Re: Need help with a script part. - -ExG-VirusKiller - 02.02.2012

nvm.


Re: Need help with a script part. - Ballu Miaa - 02.02.2012

pawn Code:
CMD:dutyon(playerid,params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0)
    {
        new string[64];
        if(IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10)
        {
            SendClientMessage(playerid, COLOR_GREY, "Turned your duty to [ON]");
            format(szMessage, sizeof(szMessage), "(Group) "EMBED_WHITE"%s is now on duty..", szPlayerName);
            SendToGroup(playerVariables[playerid][pGroup], COLOR_GENANNOUNCE, szMessage);// Try to use it like this or show me SendToGroup public function!
            SetPlayerColor(playerid,COLOR_BLUE); // << ";" This is called a Semicolor
        }
    }
    return 1;
}



Re: Need help with a script part. - PrawkC - 02.02.2012

groupVariables... sZMessage ... Hello Vortex 2.