#1

Ok so i have the /911 command scripted. Now how do i make it so it sends a message to the cops, Is it also possible to send the message to a skin id?

And also create a like a checkpoint that the officer has to drive to.
Reply
#2

Quote:
Originally Posted by Steven82
Ok so i have the /911 command scripted. Now how do i make it so it sends a message to the cops, Is it also possible to send the message to a skin id?

And also create a like a checkpoint that the officer has to drive to.
Make a loop.
Reply
#3

wat is and how do i make a loop?
Reply
#4

Quote:
Originally Posted by KDlivest954
wat is and how do i make a loop?
I don't know how your system works but I will show you how to make a loop.
Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerTeam[playerid] == Police)
{
SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
}
}
Reply
#5

thnx but can u tell me wat this means so i can learn how to do it? plz and thanks for ur time.
Reply
#6

Quote:
Originally Posted by Uniqueee
Quote:
Originally Posted by KDlivest954
wat is and how do i make a loop?
I don't know how your system works but I will show you how to make a loop.
Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerTeam[playerid] == Police)
{
SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
}
}
This code means that it will go through every player, MAX_PLAYERS being 500 the loop will run 500 times and as the loop increases so does the i integer.

The correct code would be.

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(PlayerTeam[i] == Police) // User is a cop.
        {
            SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
        }
    }
}
Don't mind the indentation it was done in notepad.
Reply
#7

kool thnx.
Reply
#8

Quote:
Originally Posted by Norn [BINMAN
]
Quote:
Originally Posted by Uniqueee
Quote:
Originally Posted by KDlivest954
wat is and how do i make a loop?
I don't know how your system works but I will show you how to make a loop.
Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerTeam[playerid] == Police)
{
SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
}
}
This code means that it will go through every player, MAX_PLAYERS being 500 the loop will run 500 times and as the loop increases so does the i integer.

The correct code would be.

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(PlayerTeam[i] == Police) // User is a cop.
        {
            SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
        }
    }
}
Don't mind the indentation it was done in notepad.
Good that you took most errors out, but SCM still has 'playerid' instead of 'i'
Reply
#9

Quote:
Originally Posted by mamoru
Quote:
Originally Posted by Norn [BINMAN
]
Quote:
Originally Posted by Uniqueee
Quote:
Originally Posted by KDlivest954
wat is and how do i make a loop?
I don't know how your system works but I will show you how to make a loop.
Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerTeam[playerid] == Police)
{
SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
}
}
This code means that it will go through every player, MAX_PLAYERS being 500 the loop will run 500 times and as the loop increases so does the i integer.

The correct code would be.

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(PlayerTeam[i] == Police) // User is a cop.
        {
            SendClientMessage(playerid,0xFFFFFFAA,"BLA BLA BLA");
        }
    }
}
Don't mind the indentation it was done in notepad.
Good that you took most errors out, but SCM still has 'playerid' instead of 'i'
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(PlayerTeam[i] == Police) // User is a cop.
        {
            SendClientMessage(i,0xFFFFFFAA,"BLA BLA BLA");
        }
    }
}
XD
Reply
#10

Thanks look like you guys have been a lot of help know could i send it 2 a player skin instead? Just wanting to know btw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)