SA-MP Forums Archive
Death on Spawn (help) - 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)
+--- Thread: Death on Spawn (help) (/showthread.php?tid=280245)



Death on Spawn (help) - Jordan69 - 31.08.2011

Hi well I've downloaded a GF edit, and everytime I spawn as a clown, with a baseball bat. When I log out or crash, I always die, I spawn at my house and it says in pink "your medical bills were blahblahblah"

And my weps are gone, and my HP is low..

I've looked all over the script and couldn't find how to fix it

Please help me, if it fixes ill donate you and +rep


Re: Death on Spawn (help) - MA_proking - 31.08.2011

check under
onplayerspawn
does anything like SetPlayerHealth(playerid, 0) there HUH
if there delete it


Re: Death on Spawn (help) - Danny20120 - 31.08.2011

Have you checked if it saves everything right, and the code is placed in right place?


Re: Death on Spawn (help) - Jordan69 - 31.08.2011

Quote:
Originally Posted by MA_proking
Посмотреть сообщение
check under
onplayerspawn
does anything like SetPlayerHealth(playerid, 0) there HUH
if there delete it
I will look in the morning, also, do you kno how to save skins on log out? Thanks.


Re: Death on Spawn (help) - MA_proking - 31.08.2011

https://sampforum.blast.hk/showthread.php?tid=122386 maybe this will help you


Re: Death on Spawn (help) - Jordan69 - 31.08.2011

This is what I found when I searched for what you said:

Quote:

if (strcmp(cmd, "/login", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /login [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
SetPlayerHealth(playerid, 0); <---- DO I ONLY REMOVE THIS? Or what Else? :\
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
if (strcmp(cmd, "/register", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new namestring = strfind(sendername, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "Immigration: Your name is not acceptable.");
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "Hint: Your name must be in the format Firstname_Lastname.");
Kick(playerid);
return 1;
}
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "That Name is already taken, please choose a different one.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /register [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
}
return 1;
}
if (strcmp(cmd, "/changepass", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /changepass [newpassword]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
if (strcmp(cmd, "/changename", true)==0)
{
tmp = strtok(cmdtext, idx);
new string2[256];
if (gPlayerLogged[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " You Are Not Logged In");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /changename [newname]");
return 1;
}
format(string, sizeof(string), "%s.ini", tmp);
if(fexist(string))
{
SendClientMessage(playerid, COLOR_GRAD1, " That nick is registered");
return 1;
}
OnPlayerRename(tmp,string,playerid);
format(string, sizeof(string), "You may now reconnect with the name %s", tmp);
SendClientMessage(playerid, COLOR_YELLOW, string);
GetPlayerName(playerid, playername, sizeof(playername));
format(string2, sizeof(string2), "%s.ini", playername);
printf("%s has changed there name to %s.", playername,tmp);
gPlayerLogged[playerid] = 0;
fremove(string2);
return 1;
}