shopcpp = CreateDynamicCP(Map[ShopCPx],Map[ShopCPy],Map[ShopCPz], 5.00, 0, Map[Interior], -1, 100.0);
evaccpp = CreateDynamicCP(Map[CPx],Map[CPy],Map[CPz], 5.00, 0, Map[Interior], -1, 100.0);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == evaccpp)
{
if(team[playerid] == TEAM_HUMAN)
{
new string[256];
if(Map[EvacType] == 1)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1408.2051,-970.8841,198.9738);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
if(Map[EvacType] == 2)
{
SetPlayerPos(playerid,3024.4983,447.9744,14.7813);
SetPlayerInterior(playerid,0);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to the water evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
if(Map[EvacType] == 3)
{
SetPlayerPos(playerid,285.5,2510.30004882817,121.5);
SetPlayerInterior(playerid,0);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to the helicopter evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
}
}
if(checkpointid == shopcpp)
{
if(team[playerid] == TEAM_HUMAN)
{
ShowPlayerDialog(playerid, DIALOG_SHOPWEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon",
"Weapon\tPrice\tAmmo\n\
Desert Eagle\t3 Coins\t40\n\
Colt 45\t1 Coin\t50\n\
SD Pistol\t2 Coins\t60\n\
Normal Shotgun\t4 Coins\t50\n\
Combat Shotgun\t7 Coins\t50\n\
MP5\t6 Coins\t120",
"Purchase", "Cancel");
}
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
switch(checkpointid)
{
case evaccpp:
{
if(team[playerid] == TEAM_HUMAN)
{
new string[256];
if(Map[EvacType] == 1)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1408.2051,-970.8841,198.9738);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
if(Map[EvacType] == 2)
{
SetPlayerPos(playerid,3024.4983,447.9744,14.7813);
SetPlayerInterior(playerid,0);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to the water evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
if(Map[EvacType] == 3)
{
SetPlayerPos(playerid,285.5,2510.30004882817,121.5);
SetPlayerInterior(playerid,0);
format(string,sizeof(string), ""chat""COL_LGREEN" %s made it to the helicopter evacuation point and has received 1 coin!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
//DisablePlayerCheckpoint(playerid);
CurePlayer(playerid);
GivePlayerXP(playerid,50);
pInfo[playerid][pEvac]++;
pInfo[playerid][pCoins]++;
SetPlayerColor(playerid,COLOR_YELLOW);
}
}
}
case shopcpp:
{
if(team[playerid] == TEAM_HUMAN)
{
ShowPlayerDialog(playerid, DIALOG_SHOPWEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon",
"Weapon\tPrice\tAmmo\n\
Desert Eagle\t3 Coins\t40\n\
Colt 45\t1 Coin\t50\n\
SD Pistol\t2 Coins\t60\n\
Normal Shotgun\t4 Coins\t50\n\
Combat Shotgun\t7 Coins\t50\n\
MP5\t6 Coins\t120",
"Purchase", "Cancel");
}
}
return 1;
}
Try this out ..
PHP код:
|