I need help in 2 things please
#1

Hello guys i need help in 2 things

Firt thing:

Like i put a hydra, And i want players who just get score 1500 drive it




Second Things:
I Want make areas to be captured
Reply
#2

You're going to have to add a section in the .ini user files for "score".

Then put an "if" to make it so a player must have 1500 score to enter it.
Reply
#3

Can you tell me how please ?
Reply
#4

For your first thingy...

Код:
new vehiclemodel = GetVehicleModel(vehicleid);
	
    if(vehiclemodel == 520)
	{
		if(GetPlayerScore(playerid) < 1500)
		{
			RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid, 0xFFFFFFFF, "Only players with a score above 1500 can use Hydras.");
		}
	}
^ Try adding this under "OnPlayerEnterVehicle".

PS: Sorry about the indentation.
Reply
#5

put it under
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
    new vehicleid=GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER)
    {
    if(GetPlayerScore(playerid) < 1500)
                {
                    if(GetVehicleModel(vehicleid)==520)
                    {
                        new Float:x,
                            Float:y,
                            Float:z;
                        GetPlayerPos(playerid, x, y, z);
                        SetPlayerPos(playerid, x, y, z+5);
                        GameTextForPlayer(playerid, "~r~Stunned", 5000, 3);
                        SendClientMessage(playerid, -1, ""COL_RED"Error: "COL_WHITE"You need 1500 or above score to drive Hydra.");
                    }
                            }
                     }
       return 1;
}
and what do you want you want to create capture zones or want a condition on that player can fly , for example: if you capture las venturas airport and if you have 1500 score then you are able to fly hydra.
Reply
#6

Quote:

public OnPlayerStateChange(playerid, newstate, oldstate)
new vehicleid=GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerScore(playerid) < 1500)
{
if(GetVehicleModel(vehicleid)==520)
{
new Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+5);
GameTextForPlayer(playerid, "~r~Stunned", 5000, 3);
SendClientMessage(playerid, -1, ""COL_RED"Error: "COL_WHITE"You need 1500 or above score to drive Hydra.");
}
}
}
return 1;
}

error 001: expected token: "-string end-", but found "-identifier-"
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : error 017: undefined symbol "COL_RED"
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : warning 215: expression has no effect
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : fatal error 107: too many error messages on one line
Reply
#7

please give your team names then i will be able to create zones for you
Reply
#8

oh sorry you need to define it on the top of the script but after includes.
pawn Код:
#define     COL_RED         0xAA3333AA
#define     COL_WHITE   0xFFFFFFAA
edit: col_red means color red . but you have not defined it in your script so you are getting these errors
Reply
#9

Quote:
Originally Posted by TomMax
Посмотреть сообщение
error 001: expected token: "-string end-", but found "-identifier-"
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : error 017: undefined symbol "COL_RED"
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : warning 215: expression has no effect
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\edku dreams\Desktop\MyScript\gamemodes\avt.pwn(333) : fatal error 107: too many error messages on one line
If you indeed want to use "OnPlayerStateChange" then just add this under it:

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);

        if(newstate == PLAYER_STATE_DRIVER)
        {
            if(GetPlayerScore(playerid) < 1500)
            {
                if(GetVehicleModel(vehicleid) == 520)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, 0xFFFFFFFF, "Only players with a score above 1500 can use Hydras.");
                }
            }
        }
It should look something like:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);

        if(GetPlayerScore(playerid) < 1500)
        {
            if(GetVehicleModel(vehicleid) == 520)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, 0xFFFFFFFF, "Only players with a score above 1500 can use Hydras.");
            }
        }
    }
    return 1;
}
Reply
#10

Quote:

please give your team names then i will be able to create zones for you

I got two teams

Firstteam : Terrorists
Secondteam: Army

Army base : Area 51


Please add me on ********
mody.hamada59@yahoo.com


or add me on skype
mido.elprins2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)