Hello There, Guest! Login or Register


Anti Ship kill script crashes server
#1
Hey all,

I have a question about my Anti Ship Kill script.
I have made a anti ship kill script.
Here is my script:
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
    new killedplayer[MAX_PLAYER_NAME];
    new string[256];
    new oldlevel;
    new newlevel;
    new jailstring[90];
    new killername[MAX_PLAYER_NAME];
   
    playercash = GetPlayerMoney(playerid);

    for(new j=0; j < MAX_SHIPZONE; j++) {
        if(killerid == playerid) return SendClientMessage(playerid,COLOR_RED,"You killed your self on ship");
        if(isPlayerInArea(playerid,ShipZone[j])) {
            GetPlayerName(killerid, killername, sizeof(killername));
            format(jailstring, sizeof(jailstring), "Newsmessage: %s has been jailed for Shipkilling", killername);
            SendClientMessageToAll(COLOR_WHITE, string);
            SetPlayerPos(killerid, 264.6288,77.5742,1001.0391);
            SetTimer("ShipJailRelease",180000,0);//after 3 minutes
               }
        }
This is the begin of my, on player death callback.
But, if i do /kill on the ship, the server crashes and gives the windows foalt, dunno how to explane in english, becoase my windows is dutch :P
And here is my /kill script.
Code:
    if(strcmp(cmd, "/kill", true) == 0) {
     SetPlayerHealth(playerid,0);
     if(Variables[playerid][Registered]){
            MyDeaths[playerid]++;
        }
            return 1;
    }

I hope you guys can help me  :)

- Dimplex
Reply
#2
Where is ShipZone[] defined?
Also, I don't see a variable called "string". Why are you trying to send that to every client?
Reply
#3
(06-02-2008, 08:16 PM)Fry link Wrote: Where is ShipZone[] defined?
Also, I don't see a variable called "string". Why are you trying to send that to every client?
Here is my Def. to ShipZone:  :7
Code:
#define MAX_SHIPZONE      3
new Float:ShipZone[MAX_SHIPZONE][4] = {
    {1995.5,1518.0, 2006.0,1569.0},
    {2015.5,1540.0, 2025.0,1550.0},
    {2005.5,1540.0, 2015.0,1549.0}
};
it works, i have already made a Anti Vehicle script whit it, and about SendClientMessageToAll, every player must get a Newsmessage, about jailing players :D
And, string has to be jailstring  :P
Reply
#4
Guys,can i know where u put this things?

thx
Reply
#5
Basic knowledge of the PAWN syntax would enable you to weave this into your existing gamemode.

In other words: if you don't know, then learn PAWN some more and try again.
Reply
#6
maybe this is the problem, in your /kill command do SetPlayerHealth(playerid, 0.0); instead of only 0
Reply
#7
(07-05-2008, 11:06 PM)Extinction link Wrote: maybe this is the problem, in your /kill command do SetPlayerHealth(playerid, 0.0); instead of only 0
it usally is something stupid.
Reply
#8
(07-06-2008, 10:17 AM)Greyfox link Wrote: it usally is something stupid.
Err,, I think u didn't made something in pawno, I had this problem too, then I changed it and now it is working so stfu
Reply
#9
Chill dude,
Fox is just saying that it probably isn't working due a "stupid" fault.
Reply
#10
(07-06-2008, 01:32 PM)EvilGate link Wrote: Chill dude,
Fox is just saying that it probably isn't working due a "stupid" fault.
no, im saying the smallest thing is usally the problem :p,
just like creting objects and wanting to move them but not using capital letters
(example)
(07-06-2008, 11:05 AM)Extinction link Wrote: Err,, I think u didn't made something in pawno, I had this problem too, then I changed it and now it is working so stfu
i second that.
Code:
    if(!strcmp(cmdtext, "/NRG", true, 4))
    {
    new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateVehicle(522, x + 2, y, z, 0, 1, 1 , 2000);
    return 1;
    }
^nothing much but still.
Reply