Creating a team
#1

Hey! I'm creating a team on my server. The ones who are in this team, is the only ones who can fly a Hydra. No one else can. I get errors and it doesnt work in-game, with this code;

Код:
     new PlayerName[24];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    
	if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == 520) //Checking if the player is the driver of a Hydra
    {
        if(!setTG[playerid] == 0)
        {
        	SendClientMessage(playerid,0xFF0000FF,"Players who's in the TG Force only!");
            RemovePlayerFromVehicle(playerid); //Removing the player from the vehicle
        }
    }
and..

Код:
	if (strcmp(cmdtext, "/setplayertg", true ) == 0)
	{
 		new tmp[256];
		tmp = strtok(cmdtext, idx);
	    new otherplayerid;
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Use /setplayertg [playerid/name]");
	    else if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, COLOR_LIGHTRED, "This player is not connected");
	    else
	    {
	        SendClientMessage(otherplayerid,COLOR_LIGHTRED,"You've been set to [Team 2] by an [Admin].");
			setTG[otherplayerid] = 1;
	    }
	    return 1;
	}
You guys are probably laughing cuz this is totally noobish or ridiculous.. but yeah, I'm still kind of new in scripting
Reply


Messages In This Thread
Creating a team - by Kudoz - 09.06.2013, 22:33
AW: Creating a team - by HurtLocker - 09.06.2013, 22:35
Re: Creating a team - by Kudoz - 09.06.2013, 22:36
AW: Creating a team - by HurtLocker - 09.06.2013, 22:47
Re: Creating a team - by Kudoz - 09.06.2013, 22:50
Re: Creating a team - by Goldilox - 10.06.2013, 00:25
Re: Creating a team - by Threshold - 10.06.2013, 01:34
Re: Creating a team - by Kudoz - 10.06.2013, 05:28
Re: Creating a team - by ReVo_ - 10.06.2013, 08:52
Re: Creating a team - by Kudoz - 10.06.2013, 13:14

Forum Jump:


Users browsing this thread: 1 Guest(s)