public Gift(playerid)
{
line pwn(5957) GiftPlayer(playerid, 1); // THIs line Error And Warnings
gifttimer[playerid] = 3600;
gettinggift[playerid] = 0;
return 1;
}
new GiftPlayer[MAX_PLAYERS];
if(strcmp(cmd, "/open", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pGiftBoxes] > 0)
{
if (GetPVarInt(playerid, "GiftWait") == 0)
{
PlayerInfo[playerid][pGiftBoxes]--;
GiftPlayer(playerid);
SetPVarInt(playerid, "GiftWait", 3);
return 1;
}
else return SendClientMessage(playerid, GREY, " You must wait 3 seconds before opening another gift.");
}
else
{
SendClientMessage(playerid, GREY, " You don't have any gifts to open.");
return 1;
}
}
return 1;
}
public CheckGas()
{
new string[128];
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(i);
if(IsNonFuelVehicle(vehicle)) { return 1; }
if(Gas[vehicle] >= 1)
{
if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); }
if(gGas[i] == 1) {
Gas[vehicle]--;
}
else
{
NoFuel[i] = 1;
TogglePlayerControllable(i, 0);
GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~The Vehicle is out of fuel~n~Use /exit to leave the vehicle",1500,3);
return 1;
}
}
}
}
}
I fail to see how you use arrays and function correctly most of the time, but fail to do so in this instance. "GiftPlayer" is not a function, it is an array and hence GiftPlayer(playerid, 1), whatever that is supposed to do, is completely invalid.
|
GiftPlayer(playerid, 1);
GiftPlayer[playerid] =1;