PDA

View Full Version : [HELP]No-Kill


Riso135
30/08/2011, 10:28 AM
Please help me ! How can i make something like that if player enters some are (cube) his weapons will disappear but when he leaves area his weapons will be loaded again (something like no-kill zone). So how pls ?

bestr32
30/08/2011, 10:30 AM
More information please lol. Like I am not understanding you.

Davz*|*Criss
30/08/2011, 10:30 AM
http://wiki.sa-mp.com/wiki/ResetPlayerWeapons

Michael@Belgium
30/08/2011, 10:32 AM
When he enter the area you have to use ResetPlayerWeapons(playerid) (http://wiki.sa-mp.com/wiki/ResetPlayerWeapons) and when he leave just use GivePlayerWeapon(playerid,weaponid,ammo) (http://wiki.sa-mp.com/wiki/GivePlayerWeapon)

[HiC]TheKiller
30/08/2011, 10:33 AM
new weapons[MAX_PLAYERS][13][2];
//When the player enters a zone
for (new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, weapons[playerid][i][0], weapons[playerid][i][1]);
ResetPlayerWeapons(playerid);

//When the player exits the zone
for (new i = 0; i < 13; i++) if(weapons[playerid][i][0] != 0) GivePlayerWeapon(playerid, weapons[playerid][i][0], weapons[playerid][i][1]);

Give that a go.

Riso135
30/08/2011, 11:39 AM
But i want to know how to make that area too (no IsPlayerInSphere) but something like IsPlayerInCube

Pinguinn
30/08/2011, 11:55 AM
IsPlayerInCube(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy, Float:minz, Float:maxz)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy && z > minz && z < maxz) return 1;
return 0;
}

Riso135
30/08/2011, 08:15 PM
IsPlayerInCube(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy, Float:minz, Float:maxz)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy && z > minz && z < maxz) return 1;
return 0;
}

where sould i put this ?

Pinguinn
30/08/2011, 08:18 PM
At the bottom of your script