03.03.2013, 17:37
Can someone told me what line to write for getting player weapons back after /exit from anywhere. When I enter in the paintball arena I have two weapons from there but when I exit my own weapon is gone !
new pWeapons[13];//idk how many weapons there are
new pAmmo[13];
for(new i=0; i < 13; i++)
{
GetPlayerWeaponData(playerid,i,pWeapons[i],pAmmo[i]);
}
for(new i=0; i < 13; i++)
{
GivePlayerWeapon(playerid,pWeapon[i],pAmmo[i]);
}
new pWeapons[13];//idk how many weapons there are
new pAmmo[13];
if (strcmp("/enterpb", cmdtext, true) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, 1310.1757, -1367.2603, 13.5262)) return SendClientMessage(playerid,0xAA3333AA,"You are not at Paintball");
{
for(new i=0; i < 13; i++)
{
GetPlayerWeaponData(playerid,i,pWeapons[i],pAmmo[i]);
}
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,-972.4957,1060.9830,1345.6690); // RC Battlefield Arena cords
SetPlayerInterior(playerid,10);
GivePlayerWeapon(playerid,24,99999); // DEAGLE
GivePlayerWeapon(playerid,27,99999); // SPAS12
SendClientMessage(playerid,0x2641FEAA,"You have joined paintball");
}
return 1;
}
if (strcmp("/exitpb", cmdtext, true) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid, 1000.0,-972.4957,1060.9830,1345.6690)) return SendClientMessage(playerid,0xAA3333AA,"You are not in Paintball Arena");
{
SetPlayerPos(playerid, 1310.1757, -1367.2603, 13.5262);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid, 1);
for(new i=0; i < 13; i++)
{
GivePlayerWeapon(playerid,pWeapon[i],pAmmo[i]);
}
SendClientMessage(playerid,0xFF6347AA,"You have left paintball");
}
return 1;
}