CMD:setteam(playerid,params[]) { if(PlayerInfo[playerid][Level] >= 7) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setteam [playerid] [teamid]"); new player1 = strval(tmp), teamid = strval(tmp2), string[256]; if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { format(string, sizeof(string), "You have set \"%s's\" team to '$%d", pName(player1), teamid); SendClientMessage(playerid,blue,string); if(player1 != playerid) { format(string,sizeof(string)," \"%s\" has set your team to '$%d'", pName(playerid), teamid); SendClientMessage(player1,blue,string); } SetPlayerTeam(playerid,teamid); } else return SendClientMessage(playerid,red,"ERROR: Player is not connected"); } else return SendClientMessage(playerid,-1,"You are not an Admin"); return 1; }
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(team[playerid] == team[issuerid])
{
new Float:health, Float:arm;
if(GetPlayerArmour(playerid) > 0)
{
GetPlayerArmour(playerid, arm);
SetPlayerArmour(playerid, floatadd(arm, amount);
}
else
{
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatadd(health, amount);
}
return 1;
}
I don't remeber the exact name of the new 0.3z callback, but if you want, you can use OnPlayerTakeDamage
PHP код:
|
I don't remeber the exact name of the new 0.3z callback, but if you want, you can use OnPlayerTakeDamage
PHP код:
|
G:\GTA SA-MP Installers\SA-MP Server\0.3x R2 Server\SATDM~FR 0.3x\gamemodes\Rg.pwn(13242) : error 028: invalid subscript (not an array or too many subscripts): "team" G:\GTA SA-MP Installers\SA-MP Server\0.3x R2 Server\SATDM~FR 0.3x\gamemodes\Rg.pwn(13242) : warning 215: expression has no effect G:\GTA SA-MP Installers\SA-MP Server\0.3x R2 Server\SATDM~FR 0.3x\gamemodes\Rg.pwn(13242) : error 001: expected token: ";", but found "]" G:\GTA SA-MP Installers\SA-MP Server\0.3x R2 Server\SATDM~FR 0.3x\gamemodes\Rg.pwn(13242) : error 029: invalid expression, assumed zero G:\GTA SA-MP Installers\SA-MP Server\0.3x R2 Server\SATDM~FR 0.3x\gamemodes\Rg.pwn(13242) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(team[playerid] == team[issuerid])
{
new Float:health, Float:arm;
if(GetPlayerArmour(playerid) > 0)
{
GetPlayerArmour(playerid, arm);
SetPlayerArmour(playerid, floatadd(arm, amount));
}
else
{
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatadd(health, amount));
}
return 1;
}
SetPlayerTeam(playerid, 1); // If the player with the team 1 shoots another player in team 1, no damage will be conflicted.
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(issuerid))
{
new Float:health, Float:arm;
if(GetPlayerArmour(playerid) > 0)
{
GetPlayerArmour(playerid, arm);
SetPlayerArmour(playerid, floatadd(arm, amount));
}
else
{
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatadd(health, amount));
}
return 1;
}
OnPlayerSpawn:
pawn Код:
pawn Код:
|
G:\GTA SA-MP Installers\SA-MP Server\0.3x R2 Server\SATDM~FR 0.3x\gamemodes\Rg.pwn(16284) : warning 202: number of arguments does not match definition |
if(GetPlayerArmour(playerid) > 0) |