Hallo ich hab mal ein Stock erstellt.
stock SpamChat()
{
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
}Der Spammt den Chat mal voll und ich will das so machen das wenn man iwo im Script SpamChat(0); macht das nur an playerid gespammt wird sobald man SpamChat(1);macht soll an alle gespammt werden also SendClientMessageToAll Wie mach ich das?
0 oder 1 eingeben 2 verschiedene sachen?
- Kindischer Namesfaker
- Geschlossen
- Erledigt
-
-
stock SpamChat(playerid)
{
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
} -
stock SpamChat(playerid,dest)
{
switch(dest)
{
case 0:
{
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
}
case 1:
{
#pragma unused playerid
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
}
}
return 1;
}/e
stock SpamChat(playerid)
{
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
}
Das hat er doch geschrieben -
stock SpamChat(playerid)
{
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
}
ups ja playerid aber mhh?Wie mach ich das dann?
SpamChat(0)= Spammt an playerid
SpamChaz(1)=Spammt an alle -
stock SpamChat(playerid,dest)
{
switch(dest)
{
case 0:
{
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
SendClientMessage(playerid,-1,"");
}
case 1:
{
#pragma unused playerid
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
SendClientMessageToAll(-1,"");
}
}
return 1;
}/e
Das hat er doch geschriebenBitte sieh erst was ich da verändert habe und was du da gemacht hast ist quatsch
-
Oder man schreibt es kürzer einfach so:
stock SpamChat(playerid,dest) {
switch(dest) {
case 0: for(new i; i<20; i++) SendClientMessage(playerid,-1,"");
case 1: for(new i; i<20; i++) SendClientMessageToAll(-1,"");
}
return 1;
}mfg.
-
-
Müsste so doch funktionieren oder?
stock SpamChat(playerid,variable)
{
switch(variable)
{
case 0:{SendClientMessage(playerid.....);}
case 1:{SendClientMessageToAll(playerid.....);}
}
return 1;
}//Und bei deinem Befehl
ocmd:spam(playerid,params[]){
new variable;
if(sscanf(params,"i",variable))return 1;
SpamChat(variable);
return 1;
} -
Du musst die ID des Spielers übergeben. Meine Methode wäre diese:
stock SpamChat(PlayerID = -1)
{
for(new i; i < 18; i++) {
if(PlayerID != -1) {
SendClientMessage(PlayerID, -1, "");
continue;
}
SendClientMessageToAll(-1, "");
}
}
Dann kannst du das hier schreiben um einen Spieler "voll zu spammen".
SpamChat(playerid)
Oder das um alle "voll zu spammen":
SpamChat() -
Kalibers art ist natürlich wieder die schnellste
Bei solch kleinen Funktionen interessiert mich die Geschwindigkeit herzlich wenig, dennoch geht es auch schneller. Die ursprüngliche Methode ohne Schleife von reoarni ist es nämlich definitiv. Sie ist nur nicht so "übersichtlich". -
breadfish.de
Hat das Thema geschlossen.