09.06.2013, 22:33
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;
and..
You guys are probably laughing cuz this is totally noobish or ridiculous.. but yeah, I'm still kind of new in scripting
Код:
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 } }
Код:
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; }