#include <a_samp>
new bool:g_CPCheck1[MAX_PLAYERS];
new bool:g_CPCheck2[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 2493.9133, -1682.3986, 13.3387, 3.0);/*XYZ Coords*/
g_CPCheck1[playerid] = true;
/*XYZ Coords*/
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new money = GetPlayerMoney(playerid);
if(money < 300 && g_CPCheck2[playerid])
{
DisablePlayerCheckpoint(playerid);
return SendClientMessage(playerid, -1, "Failed");
}
if(money <= 0 && g_CPCheck1[playerid])
{
GivePlayerMoney(playerid, 300);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2483.9133, -1672.3986, 13.3387, 3.0);
SendClientMessage(playerid, -1, "Take $300, go to the next checkpoint.");
g_CPCheck2[playerid] = true;
g_CPCheck1[playerid] = false;
}
else
return SendClientMessage(playerid, -1, "You must have $0");
return 1;
}
#include <a_samp>
new bool:g_CPCheck1[MAX_PLAYERS];
new bool:g_CPCheck2[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 2493.9133, -1682.3986, 13.3387, 3.0);/*XYZ Coords*/
g_CPCheck1[playerid] = true;
return 1;
}
new money;
public OnPlayerEnterCheckpoint(playerid)
{
if(g_CPCheck1[playerid])
{
money = GetPlayerMoney(playerid);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2483.9133, -1672.3986, 13.3387, 3.0);
SendClientMessage(playerid, -1, "I just saved your money, remember.");
g_CPCheck2[playerid] = true;
g_CPCheck1[playerid] = false;
return 1;
}
new currentmoney = GetPlayerMoney(playerid);
if(g_CPCheck2[playerid] && currentmoney < money + 300)
{
DisablePlayerCheckpoint(playerid);
return SendClientMessage(playerid, -1, "clientmessage will appear");
}
else
return SendClientMessage(playerid, -1, "clientmessage WILL NOT appear");
}
If player enter"s in checkpoint (I will create the checkpoint cases) his PlayerInfo[playerid][Money] row will be saved.
|
case 1:
{
if((MedicJob[playerid] != 1) && (pInfo[playerid][pSkin] != 33)) return SendClientMessage(playerid, -1, "Not medic!");
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 275.4052,1863.5951,8.7578, 2.0);
SendClientMessage(playerid, -1, "yr.");
SendClientMessage(playerid,-1,"y.");
MedicJob[playerid] = 2;
CP[playerid] = 0;
zombieskilled = pInfo[playerid][ZombiesKilled];
}
}
case 2:
{
if((MedicJob[playerid] == 2) && (CP[playerid] != 0)) return SendClientMessage(playerid, -1, "y!");
if(pInfo[playerid][ZombiesKilled] > zombieskilled)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, -1, "y");
SendClientMessage(playerid, -1, "y");
MedicJob[playerid] = 0;
CP[playerid] = 0;
ApplyActorAnimation(Actors[8], "DEALER", "DEALER_DEAL",4.1,0,0,0,1,1);
ApplyActorAnimation(playerid, "DEALER", "DEALER_DEAL",4.1,0,0,0,1,1);
defer ResetAction(playerid, ACTION_ANIMATION);
}
else return SendClientMessage(playerid,-1, "y");
}
Well... The code yeah why? It shouldn't give you any warnings/errors.
Tell me what you're trying to do concretely with zombies etcetera. |
zombieskilled = pInfo[playerid][ZombiesKilled];
pInfo[playerid][ZombiesKilled] = 0;
if(pInfo[playerid][ZombiesKilled] > zombieskilled)
Yes it is correct, but pInfo[playerid][ZombiesKilled] value is both the first checkpoint's and the after checkpoint.
If you wan't to skip that, reset the variable pawn Code:
pawn Code:
|
(2923) : error 017: undefined symbol "zombieskilled"
(2923) : warning 215: expression has no effect
(2929) : error 017: undefined symbol "zombieskilled"
zombieskilled = pInfo[playerid][ZombiesKilled];
if(pInfo[playerid][ZombiesKilled] > zombieskilled)