PDA

View Full Version : Player Spawning


STONEGOLD
16/02/2017, 11:28 PM
I m trying to create a saving system like CnR

There are many CnR servers which let player chooses to spawn in which city

For example:

/Settings > Change Spawn Place > 1. LS . 2.SF 3.LV

How can i save this data into database or something which let player spawns in choosen city even after relogged.


Thanks

Eloy
16/02/2017, 11:47 PM
Try

public OnPlayerSpawn(playerid)
{
switch(Player[playerid][City])
{
case 0: { SetPlayerPos(playerid, Float:PosX, Float:PosY, Float:PosZ); } // Spawn In LS
case 1: { SetPlayerPos(playerid, Float:PosX, Float:PosY, Float:PosZ); } // Spawn In SF
case 2: { SetPlayerPos(playerid, Float:PosX, Float:PosY, Float:PosZ); } // Spawn In LV
default: { SetPlayerPos(playerid, Float:PosX, Float:PosY, Float:PosZ); } // For users Bugged or using hack
}
return 1;
}


This is a example script ejecuted when a player have register data value City from register system.