[Ajuda] Salvamento de sуcio - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Salvamento de sуcio (
/showthread.php?tid=377950)
Salvamento de sуcio -
Gutierrez_zikaloko - 15.09.2012
galera tenho esse cmd de sуcio mas quando player sai do serve ou do /gmx, ele с salva.
pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if (PlayerInfo[playerid][pAdmin] >= 1338)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pSocio] = 1;
format(string, sizeof(string), " Vocк ganhou VIP socio do admin %s", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк deu VIP socio para %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
}
}
return 1;
}
if(strcmp(cmd, "/retirarsocio", true) == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк deve usar /retirarvip!");
return 1;
}
como faзo para salvar?
Re: Salvamento de sуcio -
Kuddy - 15.09.2012
1. Qual sistema de salvamento vocк usa?
2. Posta seu OnPlayerDisconnect.
Re: Salvamento de sуcio -
Gutierrez_zikaloko - 15.09.2012
ta ai.
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new car = GetPlayerVehicleID(playerid);
Police[car][Use] = false;
AttachObjectToVehicle(Police[car][Siren],0,0.0,0.0,0.0,0.0,0.0,0.0);
AttachObjectToVehicle(Police[car][Blue],0,0.0,0.0,0.0,0.0,0.0,0.0);
AttachObjectToVehicle(Police[car][Red],0,0.0,0.0,0.0,0.0,0.0,0.0);
DestroyObject(Police[car][Siren]);
DestroyObject(Police[car][Blue]);
DestroyObject(Police[car][Red]);
KillTimer(Police[car][Timer]);
Equipamentos[playerid] = 1;
sireneon[playerid] = 1;
KillTimer(tempotd[playerid]);
new caller = Mobile[playerid];
OnPlayerSave(playerid);
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, COLOR_GRAD2, "A ligaзгo caiu...");
CellTime[caller] = 0;
CellTime[playerid] = 0;
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
}
if(HireCar[playerid] > 0)
{
VTrancado[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SetVehicleToRespawn(HireCar[playerid]);
HireCar[playerid] = 0;
}
if (PlayerInfo[playerid][pBarraca] != 0)
{
RemoveBarraca(playerid);
}
if (PlayerInfo[playerid][pParedao] != 0)
{
RemoveParedao(playerid);
}
if(pRoadblock[playerid] != 0)
{
RemoveRoadblock(playerid);
}
if(pGangRoadblock[playerid] != 0)
{
RemoveGangRoadblock(playerid);
}
if(SpikeInfo[playerid][sCreated] != 0)
{
RemoveRoadPregos(playerid);
}
if(pRoadCones[playerid] != 0)
{
RemoveRoadCones(playerid);
}
switch(reason)
{
case 0: format(gstring, sizeof(gstring), "%s saiu do server por erro de conexгo ou crash", PlayerName(playerid));
case 1: format(gstring, sizeof(gstring), "%s saiu por vontade propria.", PlayerName(playerid));
case 2: format(gstring, sizeof(gstring), "%s saiu do server kickado ou banido", PlayerName(playerid));
}
ProxDetector(100.0, playerid, gstring,COR_COSA,COR_COSA,COR_COSA,COR_COSA,COR_COSA);
gActivePlayers[playerid]--;
numplayers--;
if(MudarNickAceito[playerid] == 1)
{
MudarNickAceito[playerid] = 0;
}
if(MudarSenhaAceito[playerid] == 1)
{
MudarSenhaAceito[playerid] = 0;
}
if(EstacionarAceito[playerid] == 1)
{
EstacionarAceito[playerid] = 0;
}