Need help with this script please!
#1

Hey guys I need help! I doing new gamemode and i very need some help!! So.. I did Derby GameMode and now i did client message to killerid and when some player fall in water and suicide playerid getting killerid's score and money here it is script ! OHHH AND ANOTHER PROBLEM THAT I DONT GET THE SCORE ANYWAYS!!

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new currentveh;
    currentveh = GetPlayerVehicleID(playerid);
    DestroyVehicle(currentveh);
   	SetPlayerScore(killerid,GetPlayerScore(playerid)+10);
	SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Yay! For killing you got {FFFFFF}+10 Score{FF0000}! LETS KILL MORE!");
	return 1;
}
Reply
#2

Anyone
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(currentveh);
        SetPlayerScore(killerid,GetPlayerScore(killerid)+10);
        SendClientMessage(killerid, 0xFFFFFFFF, "{FF0000}Yay! For killing you got {FFFFFF}+10 Score{FF0000}! LETS KILL MORE!");
    }
    return 1;
}
Changes:

Some "playerid" changed to "killerid"
Added code to check if the "killerid" is valid.

P.S - bumps need to be after 24hours+.
Reply
#4

Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(currentveh);
        SetPlayerScore(killerid,GetPlayerScore(killerid)+10);
        SendClientMessage(killerid, 0xFFFFFFFF, "{FF0000}Yay! For killing you got {FFFFFF}+10 Score{FF0000}! LETS KILL MORE!");
    }
    return 1;
}
Changes:

Some "playerid" changed to "killerid"
Added code to check if the "killerid" is valid.

P.S - bumps need to be after 24hours+.
So thats mean that now this wont bugging? Or you changed killerid to playerid so killerid will be playerid
Reply
#5

I meant I changed it to what you had on your code before.

For reference, in this case:

killerid = the person who made the kill which caused the callback to be called
playerid = the victim

For the score, you got the score of the victim and gave it to the killer and added 10.
Also, you sent a message to the victim saying they killed someone, which is wrong.

Try it and see if it works better, including the killerid != INVALID_PLAYER_ID code (which checks if the killer is a valid player).
Reply
#6

Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
I meant I changed it to what you had on your code before.

For reference, in this case:

killerid = the person who made the kill which caused the callback to be called
playerid = the victim

For the score, you got the score of the victim and gave it to the killer and added 10.
Also, you sent a message to the victim saying they killed someone, which is wrong.

Try it and see if it works better, including the killerid != INVALID_PLAYER_ID code (which checks if the killer is a valid player).
Ok thanks i have one more question if i will kill someone will i get +10 score? [Becouse it didnt worked before when it were bugged and where i killed myself i didnt got that but system said i got it...
Reply
#7

Hello?
Reply
#8

Try and see for yourself. From what I see it should be fine.

I already said not to bump so impatiently yet you did it again. It puts you in very bad light and it's not fun helping somebody like that.

This is a forum not a shoutbox.
Reply
#9

Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
Try and see for yourself. From what I see it should be fine.
But mine wifi now don't support other ips so i doing some scripts then giving them but i think its fine becouse it don't gave me becouse i were deleted it Anyways thanks +1 for you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)