Rickyboy30 Geplaatst: 6 oktober 2009 Rapport Geplaatst: 6 oktober 2009 Heey! In dit topic is het de bedoeling om 'kleine' scripts te plaatsen, die bijvoorbeeld handig zijn voor de nieuwere scripters onder ons! Het is dus niet de bedoeling om: - Een GameMode te posten - Een script aan te vragen, daarvoor is: http://www.gtaforum.nl/index.php?showtopic...t=0&start=0 gemaakt! - Een script te posten die nooit is getest, of die fouten bevat --------------------------------------------------------------------------------------------------------------- Reageren
Crusher!! Geplaatst: 6 oktober 2009 Rapport Geplaatst: 6 oktober 2009 (bewerkt) die bijvoorbeeld handig zijn voor de nieuwere scripters onder ons! Met name jij, je zeurt me de oren van de kop af met de SIMPELSTE EN DOMSTE DINGEN... en ik denk trouwens niet dat sandra of welke mod/admin dan ook deze topic zal pinnen.... maar voordat sandra mij gaat aanklagen wegens postboosten ofzo hier een paar cmds... >>> Door Sandra: Inderdaad, laatste waarschuwing<<< public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/heal", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid,100); return 1; } if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid,0); return 1; } if (strcmp("/armour", cmdtext, true, 10) == 0) { SetPlayerArmour(playerid,100); return 1; } if (strcmp("/score", cmdtext, true, 10) == 0) { SetPlayerScore(playerid,GetPlayerScore(playerid)+10); return 1; } return GameTextForPlayer(playerid,"~r~Foute Command",5000,5); } Bewerkt: 6 oktober 2009 door Sandra Reageren
Rickyboy30 Geplaatst: 6 oktober 2009 Auteur Rapport Geplaatst: 6 oktober 2009 Ja Crusher... hou ook van jou hoor -.- Gwn om mensen te helpen ? mag ik ? Reageren
Crusher!! Geplaatst: 6 oktober 2009 Rapport Geplaatst: 6 oktober 2009 Ja Crusher... hou ook van jou hoor -.-Gwn om mensen te helpen ? mag ik ? Je doet maar ik gaf alleen mijn mening.. Hier wat commands in DCMD!! // cmds: /announce [tekst], /pm [id] [tekst], /warn [id], /kick [id] [reason], /ban [id] [reason] #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #define COLOR_GREEN 0x33AA33AA #define MAX_WARNS 3 #define WEBSITE "www.GtaForum.nl" new warns[MAX_PLAYERS]; public OnPlayerCommandText(playerid,cmdtext[]) { dcmd(announce,8,cmdtext); dcmd(warn,4,cmdtext); dcmd(kick,4,cmdtext); dcmd(ban,3,cmdtext); dcmd(pm,2,cmdtext); // voor samp 0.3x return 0; } dcmd_announce(playerid,params[]) { if(!IsPlayerAdmin(playerid)) { return SendClientMessage(playerid,COLOR_GREEN,"You are not an ADMIN!"); } else { if(!strlen(params)) { return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /announce [text]"); } else { printf("ID: %d used '/announce : %s'",playerid,params); //Debug msg new string[128]; format(string,sizeof(string),"~w~%s ~r~: ~b~%s",Crshr_GetPlayerName(playerid),params); GameTextForAll(string,3000,5); } } return 1; } dcmd_pm(playerid,params[]) { new tmp[128],idx,id; tmp=strtok(params,idx); id=strval(tmp); if(!strlen(tmp) || !strlen(params[strlen(tmp)+1]) || !IsNumeric(tmp)) { return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /pm [playerid] [text]"); } else if(!IsPlayerConnected(id)) { return SendClientMessage(playerid,COLOR_GREEN,"The Player is not connected"); } else { printf("%s to %s : %s",Crshr_GetPlayerName(playerid),Crshr_GetPlayerName(id),params[strlen(tmp)+1 ]); //Debug msg new string[128]; format(string,sizeof(string),"PM from %s : %s",Crshr_GetPlayerName(playerid),params[strlen(tmp)+1]); SendClientMessage(id,COLOR_GREEN,string); GameTextForPlayer(id,"~w~New ~r~PM!",3000,4); GameTextForPlayer(playerid,"~r~PM ~w~Send",3000,5); } return 1; } dcmd_warn(playerid,params[]) { if(!IsPlayerAdmin(playerid)) { return SendClientMessage(playerid,COLOR_GREEN,"You are not an ADMIN!"); } else { new id=strval(params); if(!strlen(params) || !IsNumeric(params)) { return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /warn [playerid]"); } else if(!IsPlayerConnected(id)) { return SendClientMessage(playerid,COLOR_GREEN,"The Player is not connected"); } else if(IsPlayerConnected(id)) { new string[128]; format(string,sizeof(string),"You've warned %s (%d/%d)",Crshr_GetPlayerName(id),warns[id],MAX_WARNS); SendClientMessage(playerid,COLOR_GREEN,string); printf("%s has warned %s (%d/%d)",Crshr_GetPlayerName(playerid),Crshr_GetPlayerName(id),warns[id],MAX_WARNS) ; format(string,sizeof(string),"%s has warned you! (%d/%d)",Crshr_GetPlayerName(playerid),warns[id],MAX_WARNS); SendClientMessage(id,COLOR_GREEN,string); warns[id]++; if (warns[id] >= MAX_WARNS) { SendClientMessage(id,COLOR_GREEN,"<- WRITE THIS INFO DOWN ->"); SendClientMessage(id,COLOR_GREEN,"You're kicked from the server."); new kicks[128]; format(kicks,128,"Reason: You have tha maxium warns!! (max %s warns)!",MAX_WARNS); SendClientMessage(id,COLOR_GREEN,kicks); new year,month,day,hour,minute,second; getdate(year,month,day),gettime(hour,minute,second); format(kicks,128,"Date: %d/%d/%d - Time: %d:%d",day,month,year,minute,hour); SendClientMessage(id,COLOR_GREEN,kicks); format(kicks,128,"You think this is admin abuse, go to %s",WEBSITE); SendClientMessage(id,COLOR_GREEN,kicks); SendClientMessage(id,COLOR_GREEN,"GoodBye."); printf("KICK: %s is kicked from the server(reason: Warn(%d/%d)",Crshr_GetPlayerName(id),warns[id],MAX_WARNS); Kick(id); } } } return 1; } dcmd_kick(playerid,params[]) { new tmp[128],idx,id; tmp=strtok(params,idx); id=strval(tmp); if(!IsPlayerAdmin(playerid)) { return SendClientMessage(playerid,COLOR_GREEN,"You are not an ADMIN!"); } else { if(!strlen(tmp) || !strlen(params[strlen(tmp)+1]) || !IsNumeric(tmp)) { return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /kick [playerid] [reason]"); } else if(!IsPlayerConnected(id)) { return SendClientMessage(playerid,COLOR_GREEN,"The Player is not connected"); } else { printf("%s has kicked %s (reason: %s)",Crshr_GetPlayerName(playerid),Crshr_GetPlayerName(id),params[strlen(tmp)+1 ]); //Debug msg new string[128]; format(string,sizeof(string),"You've kicked %s",Crshr_GetPlayerName(id)); SendClientMessage(playerid,COLOR_GREEN,string); SendClientMessage(id,COLOR_GREEN,"<- WRITE THIS INFO DOWN ->"); SendClientMessage(id,COLOR_GREEN,"You're kicked from the server."); new kicks[128]; format(kicks,128,"Admin: %s",Crshr_GetPlayerName(playerid)); SendClientMessage(id,COLOR_GREEN,kicks); format(kicks,128,"Reason: %s",params[strlen(tmp)+1]); SendClientMessage(id,COLOR_GREEN,kicks); new year,month,day,hour,minute,second; getdate(year,month,day),gettime(hour,minute,second); format(kicks,128,"Date: %d/%d/%d - Time: %d:%d",day,month,year,minute,hour); SendClientMessage(id,COLOR_GREEN,kicks); format(kicks,128,"You think this is admin abuse, go to %s",WEBSITE); SendClientMessage(id,COLOR_GREEN,kicks); SendClientMessage(id,COLOR_GREEN,"GoodBye."); Kick(id); } } return 1; } dcmd_ban(playerid,params[]) { new tmp[128],idx,id; tmp=strtok(params,idx); id=strval(tmp); if(!IsPlayerAdmin(playerid)) { return SendClientMessage(playerid,COLOR_GREEN,"You are not an ADMIN!"); } else { if(!strlen(tmp) || !strlen(params[strlen(tmp)+1]) || !IsNumeric(tmp)) { return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /ban [playerid] [reason]"); } else if(!IsPlayerConnected(id)) { return SendClientMessage(playerid,COLOR_GREEN,"The Player is not connected"); } else { printf("%s has banned %s (reason: %s)",Crshr_GetPlayerName(playerid),Crshr_GetPlayerName(id),params[strlen(tmp)+1 ]); //Debug msg new string[128]; format(string,sizeof(string),"You've banned %s",Crshr_GetPlayerName(id)); SendClientMessage(playerid,COLOR_GREEN,string); SendClientMessage(id,COLOR_GREEN,"<- WRITE THIS INFO DOWN ->"); SendClientMessage(id,COLOR_GREEN,"You're banned from the server."); new kicks[128]; format(kicks,128,"Admin: %s",Crshr_GetPlayerName(playerid)); SendClientMessage(id,COLOR_GREEN,kicks); format(kicks,128,"Reason: %s",params[strlen(tmp)+1]); SendClientMessage(id,COLOR_GREEN,kicks); new year,month,day,hour,minute,second; getdate(year,month,day),gettime(hour,minute,second); format(kicks,128,"Date: %d/%d/%d - Time: %d:%d",day,month,year,minute,hour); SendClientMessage(id,COLOR_GREEN,kicks); format(kicks,128,"You think this is admin abuse, go to %s",WEBSITE); SendClientMessage(id,COLOR_GREEN,kicks); SendClientMessage(id,COLOR_GREEN,"GoodBye."); BanEx(id,params[strlen(tmp)+1]); } } return 1; } /* hier hoef je niks mee te doen */ stock Crshr_GetPlayerName(playerid) { new name[MAX_PLAYER_NAME] = "~"; GetPlayerName(playerid,name,sizeof(name)); return name; } strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } stock IsNumeric(const string[]) { new length=strlen(string); if (length==0) return false; for (new i = 0; i < length; i++) { if ( (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-' || (string[i]=='-' && i!=0) // A '-' but not at first. || (string[i]=='+' && i!=0) // A '+' but not at first. ) return false; } if (length==1 && (string[0]=='-' || string[0]=='+')) return false; return true; } * PasteBin * Reageren
Recommended Posts
Een reactie plaatsen
Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.