SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/04/2012, 10:56 AM   #1
Face9000
High-roller
 
Face9000's Avatar
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,258
Reputation: 185
Default Small help

Hello,so i'm scripting a cops and robbers gamemode and i maked this code:

pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1) && gTeam[playerid] == TEAM_COP
    {
    GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    return 0;
    }
    else return 1;
}

I've 2 teams,cops and civilians.Civilians has wanted level saved on the player file.The thing i wanna make,it's when a player reconnects and he gets back their wanted level,he cant choose COP as team but he can only choose CIVILIANS.So i made in that way and dont work.

I get this errors:

error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
warning 225: unreachable code
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "return"
Face9000 is offline   Reply With Quote
Old 14/04/2012, 11:13 AM   #2
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Location: pawno && htdocs
Posts: 1,660
Reputation: 113
Default Re: Small help

pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1) && gTeam[playerid] == TEAM_COP
    {
        GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    }
    else
    {
        bla bla
    }
    return 1;
}
doreto is offline   Reply With Quote
Old 14/04/2012, 11:22 AM   #3
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,085
Reputation: 111
Default Re: Small help

Quote:
Originally Posted by doreto View Post
pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1) && gTeam[playerid] == TEAM_COP
    {
        GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    }
    else
    {
        bla bla
    }
    return 1;
}
It will still give errors.

Try:

pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerWantedLevel(playerid) >= 1 && gTeam[playerid] == TEAM_COP)//error was on this line
    {
        GameTextForPlayer(playerid, "~b~~h~You can't choose cops team because you're wanted.Choose civilians", 5000, 6);
    }
    else
    {
        //bla bla
    }
    return 1;
}
__________________

Peace...

Stigg is offline   Reply With Quote
Old 14/04/2012, 11:43 AM   #4
Face9000
High-roller
 
Face9000's Avatar
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,258
Reputation: 185
Default Re: Small help

Stigg,u forgot a return 0 after GameText,i fixed.

Thanks to both.
Face9000 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ok small help out Swiftz Everything and Nothing 2 30/04/2011 02:14 AM
Small help Tee Help Archive 3 31/10/2010 09:23 AM
Small help need XxerykxX Help Archive 1 01/03/2010 10:25 PM
Small help narutogeek11 Help Archive 1 31/07/2009 02:28 AM
Small help plz cloud9 Help Archive 7 26/07/2009 03:21 PM


All times are GMT. The time now is 05:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.