/r , /z and /setrace
#1

Hello , Im new in Scripting and i need help...
I want to make these 3 cmds...
My gamemode is a Zombie Survival one...

/r is Radio for Humans ... ONLY HUMANS CAN USE IT...

/z is chat for Zombies ... ONLY ZOMBIES CAN USE IT ... and also if zombies try to talk without /z how can i make something which will show " You're Zombie , Stupid you cant Talk " or something like that..

/setrace is to set race of a player to zombie or Human... and its available for admins who are 10+ ( im using LuxAdmin script )


If you need anything from script to make these Cmds..I'll give u .. Please..i really need help.
Reply
#2

ZCMD + Sscanf + Foreach

pawn Код:
CMD:r( playerid, j[ ] )
{
    if ( gTeam[ playerid ] != humans )
        return // error message

    new
        szMSG[ 128 ]
    ;

    if ( sscanf( j, "s[128]", szMSG ) )
        return //error message

    foreach (Player, i)
    {
        if ( gTeam[ i ] == humans )  { new ABC[ 128 ]; format( ABC, 128, "TEAM MSG: %s", szMSG ); SendClientMessage( i, -1, ABC );
    }

    return 1;
}

CMD:setrace( playerid, j[ ] )
{
    if ( isadmin[ playerid ] < 100101010 )
        return // error message
 
    new id, team[ 24 ];

    if ( sscanf( j, "us[24]", id, team ) )
        return // error message

    if ( id == INVALID_PLAYER_ID )
        return // error message

    if ( !strcmp( team, "zombie", true ) )
        gTeam[ id ] = zombie;

    else if ( !strcmp( team, "human", true ) )
        gTeam[ id ] = human;

    else
        return // invalid parameter error

    return 1;
}
-[- Sorry accidentally posted the post -]-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)