SA-MP Forums Archive
help with onplayerspawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with onplayerspawn (/showthread.php?tid=130402)



help with onplayerspawn - [SF]RobMob - 26.02.2010

hi I have on my onplayerspawn these 2 pieces of code one for my dm zones and the other for my house script im using .My problem is when you die or spawn into the server you spawn at your house thats good The bad and i dont know how to fix is when your in a dm if you die say minigun dm you spawn to your house with a minigun ...lol How can I fix this


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////// DM Spawns /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(DMZone[playerid] == 1) {
new rand = random(sizeof MinigunSpawns);
SetPlayerPos(playerid, MinigunSpawns[rand][0], MinigunSpawns[rand][1], MinigunSpawns[rand][2]);
GivePlayerWeapon(playerid, 38, 1000);
}
if(DMZone[playerid] == 2)
{
SetPlayerInterior(playerid, 5);
SetPlayerPos(playerid,1299.14,-794.77,1084.00);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 24, 100);
}
if(DMZone[playerid] == 3)
{
new rand = random(sizeof shipSpawns);
SetPlayerTimedPos(playerid, shipSpawns[rand][0], shipSpawns[rand][1], shipSpawns[rand][2]);
GivePlayerWeapon(playerid, 26, 9999);
GivePlayerWeapon(playerid, 30, 9999);
GivePlayerWeapon(playerid, 30, 9999);
}
else
{
SpawnPlayerAtHouse(playerid);
}
}
GetHouseStats(playerid, pickupid)
{
for(new i=0;i<MAX_HOUSES;i++)
{
if(pickupid==HousePickup[i])
{
if(HOUSE_STATS==0)
{
new str2[256];
format(str2, sizeof(str2), "Owned by: %s", hInfo[i][Name]);
SendClientMessage(playerid, c_y, str2);
if(strcmp(hInfo[i][Renter],"ForRent",true))
{
format(str2, sizeof(str2), "Rented by: %s", hInfo[i][Renter]);
SendClientMessage(playerid, c_y, str2);
}
format(str2,sizeof(str2),"Cost: %i",hInfo[i][Cost]);
SendClientMessage(playerid, c_y, str2);
}
inhousepickup[playerid] = GetTickCount();
playericonhouse[playerid] = i;
}
}
}


Re: help with onplayerspawn - chaosnz - 24.04.2010

not sure if you have this sorted or not rob by try this..

Quote:

if(DMZone[playerid] == 0)
{
SpawnPlayerAtHouse(playerid);
}