/911 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /911 (
/showthread.php?tid=138003)
/911 -
Steven82 - 31.03.2010
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.
Re: /911 -
Nakash - 31.03.2010
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.
Re: /911 -
KDlivest954 - 31.03.2010
wat is and how do i make a loop?
Re: /911 -
Nakash - 31.03.2010
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");
}
}
Re: /911 -
KDlivest954 - 31.03.2010
thnx but can u tell me wat this means so i can learn how to do it? plz and thanks for ur time.
Re: /911 -
Norn - 31.03.2010
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.
Re: /911 -
KDlivest954 - 31.03.2010
kool thnx.
Re: /911 -
mamorunl - 31.03.2010
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'
Re: /911 -
Torran - 31.03.2010
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
Re: /911 -
Steven82 - 31.03.2010
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.