PDA

View Full Version : Death on Spawn (help)


Jordan69
31/08/2011, 06:09 AM
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

MA_proking
31/08/2011, 06:13 AM
check under
onplayerspawn
does anything like SetPlayerHealth(playerid, 0) there HUH
if there delete it

Danny20120
31/08/2011, 06:14 AM
Have you checked if it saves everything right, and the code is placed in right place?

Jordan69
31/08/2011, 06:26 AM
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.

MA_proking
31/08/2011, 06:34 AM
http://forum.sa-mp.com/showthread.php?t=122386 maybe this will help you

Jordan69
31/08/2011, 04:16 PM
This is what I found when I searched for what you said:

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;
}