Help with script
#1

How can i make every class to have different colors and different weapons?
Reply
#2

pawn Код:
public OnPlayerRequestClass(playerid, classid) {
    switch(classid) {
        case 0: // set color for class 0
        case 1: // set color for class 1
        // etc
    }
    return 1;
}
Reply
#3

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,220.3261,1822.9734,7.536;//The Place postion
SetPlayerCameraLookAt(playerid,220.3261,1822.9734, 7.536;//Camera Look at the player
SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4 141);//Camera Postiion
SetPlayerFacingAngle(playerid, 270 );//The Facing Angle
if(GetPlayerSkin(playerid) == 285)
{
GameTextForPlayer(playerid, "~b~SWAT", 1000, 4);
}
else if(GetPlayerSkin(playerid) == 294)
{
GameTextForPlayer(playerid, "~r~Mafia", 1000, 4);
}

switch(classid) {
case 0:SetPlayerColor(playerid, 0xFF0000AA);
case 1:SetPlayerColor(playerid, 0x0000BBAA);

return 1;
}


Errors:
C:\Users\DELL\Desktop\TDM 1.1\gamemodes\TDM.pwn(74) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\DELL\Desktop\TDM 1.1\gamemodes\TDM.pwn(74) : warning 215: expression has no effect
Reply
#4

pawn Код:
public OnPlayerRequestClass(playerid, classid) {
    SetPlayerPos(playerid,220.3261,1822.9734,7.536;//The Place postion
    SetPlayerCameraLookAt(playerid,220.3261,1822.9734, 7.536;//Camera Look at the player
    SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4 141);//Camera Postiion
    SetPlayerFacingAngle(playerid, 270 );//The Facing Angle
    if(GetPlayerSkin(playerid) == 285) {
        GameTextForPlayer(playerid, "~b~SWAT", 1000, 4);
        SetPlayerColor(playerid, 0xFF0000AA);
    }
    else if(GetPlayerSkin(playerid) == 294) {
        GameTextForPlayer(playerid, "~r~Mafia", 1000, 4);
        SetPlayerColor(playerid, 0x0000BBAA);
    }
    return 1;
}
Reply
#5

how can i made when i kill someone to show on the right?
Reply
#6

Quote:
Originally Posted by icko202
Посмотреть сообщение
how can i made when i kill someone to show on the right?
What do you mean exactly mate?
Reply
#7

in the gang wars servers when you kill someone it shows on the right your name killed the person with what weapon
Reply
#8

https://sampwiki.blast.hk/wiki/SendDeathMessage

pawn Код:
SendDeathMessage(killerid, playerid, reason);
Reply
#9

Find this in your PAWNO:

Код:
public OnPlayerDeath(playerid, killerid, reason)
And then do this:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    return 1;
}
So if you already got other codes onplayerdeath, just add that SendDeathMessage at top, before others.
Good luck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)